<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<%@ include file="/static/htm/head" %>
		<title>游戏论坛帖子专区</title>
	</head>
	<body style="font-size:15px;">
		<div style="text-align: center;">
			<a href="index.jsp">
				<img alt="论坛Logo" height="56" src="static/pic/logo.jpg" width="192">
			</a>
		</div>
		<table width="100%">
			<tr>
				<td>
					<a href="index.jsp">
						返回论坛首页
					</a>
				</td>
				<td style="text-align: right;">
					<%@ include file="/static/htm/user.jsp" %>
				</td>
			</tr>
		</table>
		<h1 align="center"><font color="red">${game.name }</font>&nbsp;专区</h1>	
			<a class="btn btn-success" href="permit/post?id=${param.id}" style="float:right;">&nbsp;发新帖&nbsp;</a>
			<a class="btn btn-danger" href="permit/postproduct?id=${param.id}" style="float:right;margin-right:15px;">&nbsp;发布商品&nbsp;</a>		
		<table class="table table-striped">
        <thead>
          <tr>
            <th>#</th>
            <th>标题</th>
            <th>发表时间</th>
            <th>发帖人</th>
          </tr>
        </thead>
        <tbody>
			<c:if test="${posts eq null }">
			<tr>
				<td colspan="4">
					<font color="red">${game.name}</font>游戏暂时没有用户发表帖子,请积极发帖交流。
				</td>
			</tr>
			</c:if>
			<c:if test="${posts ne null }">
				<c:forEach var="post" items="${posts }" varStatus="num">
					<tr>
						<td>
							${num.index + 1}
						</td>
						<td>
							<a href="readpost?postid=${post.postId}">${post.title }</a>
						</td>
						<td>
							${post.postTime }
						</td>
						<td>
							${post.userName }
						</td>
					</tr>
				</c:forEach>
			</c:if>			
        </tbody>
      </table>
	   <%@ include file="/static/htm/foot.jsp" %>	
	</body>
</html>